var chrome = {
    windows = {
        WINDOW_ID_NONE = -1,
        create = function(data, callback) {
            var win = opera.extension.windows.create();
            this.getAll(function(list) { win.id = list.length - 1; });
            if(callback) callback(win);
        },
        get = function(id, callback) {
            if(callback) this.getAll(function(list) { callback(list[id]); });
        },
        getAll = function(callback) {
            if(callback) callback(opera.extension.windows.getAll()); //callback(list);
        },
        getCurrent = function(callback) {
            this.getLastFocused(callback);
        },
        getLastFocused = function(callback) {
            if(callback) callback(opera.extension.windows.getFocused());
        },
        remove = function(id, callback) {
            if(callback) callback();
        },
        update = function(id, info, callback) {
            this.get(id, function(win) {
                for(var prop in info) if(prop in win) win[prop] = info[prop];
                if(callback) callback(win);
            });
        },
        onCreated = { addListener: function(callback) { opera.extension.windows.addEventListener('create', callback); }},
        onFocusChanged = { addListener: function(callback) { opera.extension.windows.addEventListener('focus', callback); }},
        onRemoved = { addListener: function(callback) { opera.extension.windows.addEventListener('close', callback); }}
    },
    tabs = {
        all = [],
        captureVisibleTab = function(id, options, callback) {
            callback('  AAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFz  ByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSp  a/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJl  ZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uis  F81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PH  hhx4dbgYKAAA7');
        },
        connect = function(id, info) {
            // ...
        },
        create = function(props, callback) {
            props.focused = props.selected; delete props.selected;
            var win = opera.extension.tabs.create(props);
            win.id = this.all.push(win) - 1;
            if(callback) callback(win);
        },
        detectLanguage = function(id, callback) {
            if(callback) callback('en');
        },
        executeScript = function(id, details, callback) {
            if(callback) callback();
        },
        get = function(id, callback) {
            if(callback) callback(this.all[id]);
        },
        getAllInWindow = function(id, callback) {
            if(callback) chrome.windows.get(id, function(win) { callback(win.tabs); });
        },
        getCurrent = function(callback) {
            this.getSelected(0, callback);
        },
        getSelected = function(winId, callback) {
            if(callback) callback(opera.extension.tabs.getFocused());
        },
        insertCSS = function(id, details, callback) {
            callback();
        },
        move = function(id, moveProperties, callback) {
            callback(this.all[id]);
        },
        remove = function(id, callback) {
            callback();
        },
        sendRequest = function(id, request, callback) {
            // ...
            callback();
        },
        update = function(id, props, callback) {
            var tab = this.all[id];
            props.focused = props.selected; delete props.selected;
            for(var prop in props) if(prop in tab) tab[prop] = props[prop];
            callback(tab);
        },
        onAttached = { addListener: function(callback) { /* ... */ } },
        onCreated = { addListener: function(callback) { opera.extension.tabs.addEventListener('create', callback, false); } },
        onDetached = { addListener: function(callback) { /* ... */ } },
        onMoved = { addListener: function(callback) { /* ... */ } },
        onRemoved = { addListener: function(callback) { opera.extension.tabs.addEventListener('close', callback, false); } },
        onSelectionChanged = { addListener: function(callback) { opera.extension.tabs.addEventListener('focus', callback, false); } },
        onUpdated = { addListener: function(callback) { /* ... */ } }
    }
}